package com.sto.common.driverCost.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 基础字段
 *
 * @author ChenPeng
 * @since 2022-07-15 10:12
 */
@Data
public class BaseEntity {
    public static final String GMT_CREATE = "gmtCreate";
    public static final String GMT_MODIFIED = "gmtModified";
    public static final String CREATOR = "creator";
    public static final String EDITOR = "editor";

    public static final String FIELD_ID = "id";
    public static final String FIELD_VALID = "valid";
    public static final String FIELD_GMT_CREATE = "gmt_create";
    public static final String FIELD_GMT_MODIFIED = "gmt_modified";
    public static final String FIELD_CREATOR = "creator";
    public static final String FIELD_EDITOR = "editor";

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String creator;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String editor;

}
